home *** CD-ROM | disk | FTP | other *** search
- /************************************************************
- *
- * Created: Sunday, January 20, 1991 4:11:08 PM
- * CIDIndex.h
- * C++ class definition for index objects
- *
- *
- * Copyright Neologic Systems 1992
- * All rights reserved
- *
- *
- * Within a class, references to permanent objects are kept in a sorted list called a
- * index. The default sorting order in an index is ascending by ID value, however
- * other sorting orders are possible. The class CIDIndex implements a sample
- * secondary index.
- *
- ***********************************************************/
- #pragma once /* Include this file only once */
- #ifndef __CIDIndex__
- #define __CIDIndex__ 1
-
- #include "NeoTypes.h"
- #include CNeoNodeH
-
- const NeoID kIDIndexID = 17;
-
- typedef struct {
- NeoID fID; // identity of the object this entry refers to
- } IDIndexEntry;
-
- class CIDIndex : public CNeoNode {
- public:
- /** Instance Methods **/
- CIDIndex(const short aCount, CNeoNode *aParent, const NeoID aID);
- #ifdef qMacApp
- virtual ~CIDIndex(void);
- #endif
- static CNeoPersist *New(void);
- virtual NeoID getClassID(void) const;
- virtual long getFileLength(void) const;
-
- /** I/O Methods **/
- virtual void readObject(CNeoStream *aStream, const NeoTag aTag);
- virtual void writeObject(CNeoStream *aStream, const NeoTag aTag);
-
- /** Object List Management Methods **/
- virtual CNeoPersist *
- getObject(const short aIndex);
- virtual CNeoNode * insertObject(const short aIndex, CNeoPersist *aObject);
- static void * KeyManager(const NeoKeyOp aOp, ...);
-
- /** Entry Methods **/
- virtual short getEntrySize(void) const;
-
- protected:
- #ifdef qNeoDebug
- /** Debugging Methods **/
- virtual const void *verify(const void *aValue) const;
- #endif
-
- /** Instance Variables **/
- public:
- IDIndexEntry fEntry[kNeoDefaultNodeEntryCount]; // references to objects in the list
- };
-
- enum {kIDIndexFileLength = (kNeoNodeFileLength + (sizeof(IDIndexEntry) * kNeoDefaultNodeEntryCount))};
- #endif
-